﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace ThreadingApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Storehouse store = new Storehouse(64);

            Producer p1 = new Producer(store, "Cake Producer", 2000);
            Consumer c1 = new Consumer(store, "Consumer 1", 1500);

            Thread thread = new Thread(new ThreadStart(p1.Run));
            thread.Start();

            Thread.Sleep(4000);

            Thread thread2 = new Thread(new ThreadStart(c1.Run));
            thread2.Start();

            Console.ReadLine();

            thread.Join();
        }
    }
}
